package com.jy.modules.cims.component.sysAssist;

import com.jy.modules.cims.common.sysUtils.PropertyUtil;
import com.jy.modules.cims.interact.common.InteractConstant;
import com.tongbanjie.open.api.TbjApiHelper;
import com.tongbanjie.open.api.log.InfoLogger;

/**
 * @description 获取TbjApiHelper
 * @author shengzhoutao
 * @author shengzhoutao
 * @date 2015-09-07
 */
public class TbjApiHelperSingleton {
	private volatile static TbjApiHelper helper;

	private TbjApiHelperSingleton() {

	}

	public static TbjApiHelper getTbjApiHelper() {
		if (helper == null) {
			synchronized (TbjApiHelperSingleton.class) {
				if (helper == null) {
					// 铜板街为我司提供id
					String appId = PropertyUtil.get(InteractConstant.TBJ_SERVICE_APPID);
					// 铜板街服务版本号
					String version = PropertyUtil.get(InteractConstant.TBJ_SERVICE_VERSION);
					// 铜板街服务md5key
					String md5key = PropertyUtil.get(InteractConstant.TBJ_SERVICE_MD5KEY);
					// 铜板街服务aeskey
					String aesKey = PropertyUtil.get(InteractConstant.TBJ_SERVICE_AESKEY);

					helper = new TbjApiHelper(new InfoLogger(TbjApiHelper.class), md5key, aesKey, "UTF-8", null, appId, version);
				}
			}
		}
		return helper;
	}
}
